import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-11-17
 * 16:08
 */
public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n=scan.nextInt();
        int count=0;
        int can=0;
        int must=0;
        int[] arr=new int[n];//每个人的ID
        int[] arr1=new int[n];//每个ID的数量
        for(int i=0;i<n;i++){
            arr[i]=scan.nextInt();
        }
        for(int i=0;i<n;i++){
            arr1[arr[i]-1]++;
        }
        for(int i=0;i<n;i++){
            if(arr1[i]==1){//id为1的数量,可以修改的ID
                can++;
            }else if(arr1[i]>2){//id为大于2的数量,必须改
                must+=arr1[i]-2;
            }
        }
        if(must>=can){
            System.out.print(must);
        }else{
            System.out.print(must+(can-must)/2);
        }
        scan.close();
    }
}